<?php defined('IN_PHPCMS') or exit('Access Denied'); ?><?php $si=0;$subcount=count($subs);?>
<?php if(is_array($subs)) foreach($subs AS $sid => $data) { ?>
<?php $si++;$i=0;?>
<table  cellpadding="0" cellspacing="1" class="table_form">
  <caption>
  <span class="f_r" style="padding-right:10px;">
  投票人数：<?php echo $vote_data[$voteid]['votes'];?>
  <if $subcount==1> 总票数：<?php echo $vote_data[$sid]['total'];?></if>
  <?php if($subcount>1) { ?>
  (总票数：<?php echo intval($vote_data[$sid][total]);?>)
  <?php } ?>
  </span>
  <span class="f_l" style="padding-left:10px;"><?php echo $data['subject'];?></span>
  </caption>
  
  <?php if(is_array($data[options])) foreach($data[options] AS $optionid => $option) { ?>
  <?php $i++; $votes=intval($vote_data[$sid][$optionid]);$per=0;?>
  <?php if($vote_data[$sid]['total']) { ?>
  <?php $per=intval($votes/$vote_data[$sid]['total']*100);?>
  <?php } ?>
  <tr>
    <td width="30%" class="option"><?php echo $i;?> . <?php echo $option['option'];?></td>
    <td width="10%" align="center"><?php echo $votes;?></td>
    <td width="30%"><div class="bar" style="width:<?php echo $per;?>%">&nbsp;</div></td>
    <td width="10%" align="center"><?php echo $per;?> % </td>
  </tr>
  <?php } ?>
</table>
<?php } ?>
